package com.rpframework.website.friendly.service;

import java.util.Arrays;

public class Test {
	public void run(){
		/*银币*/
		String[] silver = { "银币10000", "银币5000", "银币2000", "银币1000", "银币500"};  
		/*银币倍数*/
		String[] silverb = { "银币倍数2000%", "银币倍数1000%", "银币倍数500%", "银币倍数200%", "银币倍数100%" };  
		/*经验*/
		String[] exp = { "经验30W", "经验20W", "经验15W", "经验10W", "经验5W" };  
		/*经验倍数*/
		String[] expb = { "经验倍数800%", "经验倍数500%", "经验倍数300%", "经验倍数200%", "经验倍数100%" };  
		/*心法*/
		String[] citta = { "心法10", "心法8", "心法5", "心法3", "心法1" };  
		String[] arr = concatAll(silver, silverb,exp,expb,citta);
		String s1 ;
		String s2 ;
		int count=0;
		int num = 0;
		while(true){
			count++;
			s1 = random2(arr);
			s2 = random2(arr);
			if(num == 100){
				break;
			}
			if(("经验倍数800%".equals(s1)&&"经验30W".equals(s2))||("经验倍数800%".equals(s2)&&"经验30W".equals(s1))){
				System.out.println(s1+" "+s2+",共计刷新次数"+count+"次！"+"需要元宝数量："+count*500);
				num++;
				count=0;
				continue;
			}
		}
	}
	@SuppressWarnings("unchecked")
	public static <T> T[] concatAll(T[] first, T[]... rest) {  
		  int totalLength = first.length;  
		  for (T[] array : rest) {  
		    totalLength += array.length;  
		  }  
		  T[] result = Arrays.copyOf(first, totalLength);  
		  int offset = first.length;  
		  for (T[] array : rest) {  
		    System.arraycopy(array, 0, result, offset, array.length);  
		    offset += array.length;  
		  }  
		  return result;  
	}
	public String random2(String[] arr){
		int n = (int)((Math.random())*25);
		return arr[n];
	}
}
